//
//  ViewController.m
//  Demo
//
//  Created by MacPro on 15/12/3.
//  Copyright © 2015年 pccb. All rights reserved.
//

#import "ViewController.h"
#import "HomeMenuCollectionViewCell.h"
#import "AddActivityPersonView.h"
#import "PublicBuyNumberView.h"
#import "PeriodTimeView.h"
#import "MakeSucessView.h"
#import "PriceChartView.h"
#import "MySegmentView.h"

@interface ViewController ()
{
    MySegmentView *_topGrowView;
}

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    PeriodTimeView *buyVC = [[PeriodTimeView alloc] initPeriodTimeViewWithFrame:CGRectMake(0, 100, SCREEN_WIDTH, 202)];
    buyVC.SubmitPeriodTimeBlock = ^(NSString *startTime, NSString *endTime){
        
        NSLog(@"选中 startTime = %@  endTime = %@ ",startTime,endTime);
    
    };
    buyVC.center = self.view.center;
    
    [self.view addSubview:buyVC];
    
    
    NSLog(@"SCREEN_WIDTH = %f",SCREEN_WIDTH);
    
    
   
//    UIView *_topBlueBackView = [[UIView alloc] initWithFrame:CGRectMake(0, 50, SCREEN_WIDTH, 216*SCREEN_HEIGHT_RATE)];
//    _topBlueBackView.backgroundColor = DefaultColor_BlueButton;
//    _topBlueBackView.layer.borderColor = [UIColor redColor].CGColor;
//    [self.view addSubview:_topBlueBackView];
//    
//    if (_topGrowView == nil) {
//        
//        _topGrowView = [[PriceChartView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 216*SCREEN_HEIGHT_RATE)];
//        _topGrowView.hidden = NO;
//        _topGrowView.layer.borderColor = [UIColor clearColor].CGColor;
//        [_topBlueBackView addSubview:_topGrowView];
//    }
//    
//    [_topGrowView updateGrowProgressView:@{@"user_leve":@3,@"float_level":@3.4,@"total_growth":@1200}];
    
//    _topGrowView = [[MySegmentView alloc] initWithFrame:CGRectMake(0, 100, SCREEN_WIDTH, 40) withTitle:@[@"项目概述",@"项目详情",@"投资记录"]];
//    _topGrowView.clickSegmentViewBlock = ^(NSInteger index){
//        
//        NSLog(@"点击了 %ld",index);
//    
//    };
//    [self.view addSubview:_topGrowView];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (id)returnNoNullResponseObject:(id)responseObject
{

    NSMutableDictionary *subObject = [NSMutableDictionary dictionary];  ;
    
    for (id key in responseObject) {
        
        id value = [responseObject objectForKey:key];
        
        if (value == nil || value == [NSNull null]) {
            value = @"";
        }else if ([value isKindOfClass:[NSNumber class]]) {
            value = [NSString stringWithFormat:@"%@",value];
        }else if ([value isKindOfClass:[NSDictionary class]]) {
            value = [self returnNoNullResponseObject:value];
        }

        [subObject setObject:value forKey:key];
        
        NSLog(@"object == %@",key);
        NSLog(@"info === %@",[responseObject objectForKey:key]);
    }
    
    NSLog(@"subObject  == %@",subObject);
    
    return subObject;
}

@end
